{extends file='layout/admin.html'}

{block name='title'} manage{/block}

{block name='content'}

<div class="clearfix sub_nav">
	<span class="btn fr"><a href="admin/admin_manage/add.html">Add</a></span>
</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="content_table">
	<thead>
		<tr style="height: 10px">
			<th class="left" style="width: 35%;">User Name</th>
			<th style="border-left: 1px solid #CCC; width: 35%;">User Group</th>
			<th style="border-left: 1px solid #CCC; width: 10%;">Date Added</th>
			<th class="right" style="border-left: 1px solid #CCC; width: 20%;" >Action</th>
		</tr>
	</thead>
	<tbody class="text_indent">
	  {foreach $data as $val}
	  {if $val@iteration % 2}<tr>{else}<tr class="odd">{/if}
  		<td>{$val.user_name}</td>
			<td style="border-right-style: none; border-right-width: initial; border-right-color: initial; ">{$admin_group[$val.user_group]['group_name']}</td>
			<td style="border-right-style: none; border-right-width: initial; border-right-color: initial;">{date('m/d/Y', $val.add_time)}</td>
			<td style="border-right-style: none; border-right-width: initial; border-right-color: initial; text-align: center;">
			  <a href="#">Select Actions <img src="images/i.gif" alt="Action menu" class="arrow" /></a>
			  <div class="action_btn">
				<ul class="action_menu">
					<li><a href="admin/admin_manage/edit/{$val.id}.html">Edit</a></li>
					<li><a href="admin/admin_manage/delete/{$val.id}" class="delete">Delete</a></li>
				</ul>
			</div></td>
		</tr>
	  {/foreach}
	</tbody>
</table>
<div class="clearfix sub_nav">
  {include file="lib/admin_pager.html"}
	<span class="btn fr"><a href="admin/admin_manage/add.html">Add</a></span>
</div>
<script type="text/javascript" charset="utf-8">

$('.arrow').each(function(){
  $(this).parent().popup($(this).parent().next());
});

$('a.delete').click(function(){
  var url = this.href;
  confirm('Are you sure to delete this?', function(){
    location.href = url;
  });

  return false;
});

</script>
{/block}